Skip to content

Conversation

migmartri
Copy link
Member

$ chainloop wf run describe --digest sha256:29da604ade4ddc9e35f675c7b7fc6355d0b381ca23fab5d1a0614a8ea10ea425 -o statement
{
   "type": "https://in-toto.io/Statement/v1",
   "subject": [
      {
         "name": "chainloop.workflow.test",
         "digest": {
            "sha256": "053857d8d1976a3008d2ca35797021a40919dd441915b179a925e4b37015ccde"
         }
      },
      {
         "name": "git.head",
         "digest": {
            "sha1": "cb798c19caec6932684aa97e279318dc64265c98"
         },
         "annotations": {
            "author.email": "miguel@chainloop.dev",
            "author.name": "Miguel Martinez Trivino",
            "date": "2023-11-09T10:40:17Z",
            "message": "rebase\n\nSigned-off-by: Miguel Martinez Trivino \u003cmiguel@chainloop.dev\u003e\n",
            "remotes": [
               {
                  "name": "origin",
                  "url": "git@github.com:migmartri/chainloop.git"
               },
               {
                  "name": "upstream",
                  "url": "git@github.com:chainloop-dev/chainloop.git"
               }

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Copy link
Member

@danlishka danlishka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

@migmartri migmartri merged commit 617a903 into chainloop-dev:main Nov 9, 2023
@migmartri migmartri deleted the get-attestation-by-digest branch November 9, 2023 12:21
}

if runID == "" && attestationDigest == "" {
return errors.New("either a run ID or the attestation digest needs to be provided")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[very nit]

must be provided

Comment on lines +87 to +93
if digest != "" {
req.Ref = &pb.WorkflowRunServiceViewRequest_Digest{Digest: digest}
} else if runID != "" {
req.Ref = &pb.WorkflowRunServiceViewRequest_Id{Id: runID}
}

resp, err := client.View(ctx, req)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit]
Maybe the 2nd branch could be a simple else.
Not a big deal though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants